import { defHttp } from '@/utils/http/axios';
import { ErrorMessageMode } from '#/axios';


export interface ExecuteSQLParams {
  sql: string;
}

export function executeSQL(params: ExecuteSQLParams, mode: ErrorMessageMode = 'message') {
  return defHttp.post<Object[]>(
    {
      url: '/plugin/bi/sql',
      params,
    },
    {
      errorMessageMode: mode
    }
  );
}
